package com.yc.cloud.openai.portal.enums;


import java.util.Objects;

import lombok.Getter;

@Getter
public enum GPTChatProvider {
    LINK_AI("1", "LINK_AI"),
    FASTGPT("2", "FASTGPT"),
    DEFAULT("0", "LINK_AI");


    private final String key;
    private final String value;

    GPTChatProvider(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static GPTChatProvider fromKey(String key) {
        for (GPTChatProvider provider : GPTChatProvider.values()) {
            if (Objects.equals(provider.getKey(), key)) {
                return provider;
            }
        }
        throw new IllegalArgumentException("Unknown provider key: " + key);
    }
}

